<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>Document</title>
        <script src = 'jquery-1.10.1.min.js'></script>
        <script>
            /* 
                $().load()
                $.get()
                $.post()
             */

             $(function(){
                 $("#btn1").click(function(){
                     /* $.ajax({
                         type: "get",
                         url: "1.txt",
                         data: {

                         },
                         success: function(data, statusText, xhr){
                             
                                // statusText success  error
                                // xhr ajax对象
                             
                            alert(data + ", " + statusText);
                         },
                         error: function(msg){
                             alert(msg);
                         }
                     }) */


                     $.ajax({
                         type: "get",
                         url: "https://api.asilu.com/weather/",
                         data: {
                             city: "青岛"
                         },
                         dataType: "jsonp",
                         success: function(data, statusText){
                            // alert(data + ", " + statusText);
                            console.log(data);
                            
                         },
                         error: function(msg){
                             alert(msg);
                         }
                     })
                 })
             })
        </script>
    </head>
    <body>
        <button id = 'btn1'>下载数据</button>
    </body>
</html>